//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __POLICIES_H__
#define __POLICIES_H__
#include<elatypes.h>
#include"FixedList.h"
#include"PowerDef.h"
_ELASTOS_NAMESPACE_USING

enum
{
    LENGTH = 10,
    PEAKLENGTH = 4
};

class Policy
{
public :
    Mode GetCpuMode(UInt32 usage);
    void SetPolicy(PolicyType type);
    PolicyType GetPolicy();
    Policy();
    Policy(PolicyType type);
    ~Policy();
private :
    FixedList * pusage_records;
    FixedList * pmode_records;
    UInt32 CurrentPolicy;

    UInt32 GetMode(UInt32 usage);
    UInt32 DoPeak(UInt32 usage);
    UInt32 DoStepped(UInt32 usage);
    UInt32 DoAVG(UInt32 usage);
};
#endif//__POLICIES_H__
